import { Table, Badge, Menu, Dropdown, Space,Input } from 'antd';
import { DownOutlined } from '@ant-design/icons';

const menu = (
  <Menu>
    <Menu.Item>Action 1</Menu.Item>
    <Menu.Item>Action 2</Menu.Item>
  </Menu>
);

function NestedTable() {
  const expandedRowRender = () => {
    const columns = [
      { title: '序号', dataIndex: 'seqNo', key: 'seqNo' },
    
    { title: '加料名', dataIndex: 'name', key: 'name' },
    { title: '当前数量', dataIndex: 'latest', key: 'count' },
    { title: '计量单位', dataIndex: 'unitOfMeasure', key: 'unitOfMeasure' },
    { title: '已制作数量', dataIndex: 'makeCount', key: 'makeCount' },
    { title: '调整数量', dataIndex: 'changeCount', key: 'changeCount' },
    { title: '调整后数量', dataIndex: 'afterCount', key: 'afterCount' },
    ];

    const data = [];
    for (let i = 0; i < 3; ++i) {
      data.push({
        key: i,
      seqNo: i+1,
      name: '加料'+(i+1),
      count: '5',
      unitOfMeasure: '元/吨',
      makeCount: 3,
      changeCount:"输入框",
      afterCount:'100',

      });
    }
    return <Table showHeader={false}  columns={columns} dataSource={data} pagination={false} />;
  };

  const columns = [
    { title: '序号', dataIndex: 'seqNo', key: 'seqNo' },
    { title: '菜品名', dataIndex: 'name', key: 'name' },
    { title: '当前数量', dataIndex: 'latest', key: 'count' },
    { title: '计量单位', dataIndex: 'unitOfMeasure', key: 'unitOfMeasure' },
    { title: '已制作数量', dataIndex: 'makeCount', key: 'makeCount' },
    { title: '调整数量', dataIndex: 'changeCount', key: 'changeCount' },
    { title: '调整后数量', dataIndex: 'afterCount', key: 'afterCount' },
  ];

  const data = [];
  for (let i = 0; i < 3; ++i) {
    data.push({
      key: i,
      seqNo: i+1,
      name: '菜品'+(i+1),
      count: '5',
      unitOfMeasure: '元/吨',
      makeCount: 3,
      changeCount:"输入框",
      afterCount:'100',
    });
  }

  return (
    <Table
      className="components-table-demo-nested"
      columns={columns}
      expandable={{ expandedRowRender }}
      defaultExpandAllRows={true}
      dataSource={data}
    />
  );
}

export default NestedTable;